In computing, a coroutine can be viewed as a generalized routine entity which supports suspend and resume operations in addition to the invoke and return operations that are typically supported by routines. That is, a coroutine can be invoked (a.k.a. called) and upon completion can return a value to the caller, and in this sense operates like other kinds of routine entities (e.g., functions, procedures). In addition, however, a coroutine can suspend execution, pass control to another piece of code (possibly yielding a value as well), and later resume execution at the point of suspension. Some coroutines have multiple suspension points. Some are re-entrant, i.e., they may be called again (creating another instance) prior to completion of an earlier call. Coroutines can be used when implementing cooperative tasks, exceptions, event loops, iterators, continuations, infinite lists and pipes, for example.